// ************************************************************************ //
// WARNING                                                                    
// -------                                                                    
// The types declared in this file were generated from data read from a       
// Type Library. If this type library is explicitly or indirectly (via        
// another type library referring to this type library) re-imported, or the   
// 'Refresh' command of the Type Library Editor activated while editing the   
// Type Library, the contents of this file will be regenerated and all        
// manual modifications will be lost.                                         
// ************************************************************************ //

// C++ TLBWRTR : $Revision:   1.134.1.39  $
// File generated on 19.12.2006 15:25:18 from Type Library described below.

// ************************************************************************ //
// Type Lib: D:\Program Files\ASCON\KOMPAS-3D V8 Plus\Bin\kGAX.TLB (1)
// IID\LCID: {B97871C2-BB9B-49E7-8FD3-C1201922EDD8}\0
// Helpfile: D:\Program Files\ASCON\KOMPAS-3D V8 Plus\Bin\KGAX.hlp
// DepndLst: 
//   (1) v2.0 stdole, (C:\WINDOWS\System32\stdole2.tlb)
//   (2) v4.0 StdVCL, (C:\WINDOWS\System32\stdvcl40.dll)
//   (3) v1.0 Kompas6API5, (K:\Debug\Exe\kAPI5.TLB)
// ************************************************************************ //
#ifndef   __KGAXLib_TLB_h__
#define   __KGAXLib_TLB_h__

#pragma option push -b -w-inl

#include <utilcls.h>
#if !defined(__UTILCLS_H_VERSION) || (__UTILCLS_H_VERSION < 0x0500)
//
// The code generated by the TLIBIMP utility or the Import|TypeLibrary 
// and Import|ActiveX feature of C++Builder rely on specific versions of
// the header file UTILCLS.H found in the INCLUDE\VCL directory. If an 
// older version of the file is detected, you probably need an update/patch.
//
#error "This file requires a newer version of the header UTILCLS.H" \
       "You need to apply an update/patch to your copy of C++Builder"
#endif
#include <olectl.h>
#include <ocidl.h>
#if defined(USING_ATLVCL) || defined(USING_ATL)
#if !defined(__TLB_NO_EVENT_WRAPPERS)
#include <atl/atlmod.h>
#endif
#endif
#include "ks_TLB.h"


// *********************************************************************//
// Forward reference of some VCL types (to avoid including STDVCL.HPP)    
// *********************************************************************//
namespace Stdvcl {class IStrings; class IStringsDisp;}
using namespace Stdvcl;
typedef TComInterface<IStrings> IStringsPtr;
typedef TComInterface<IStringsDisp> IStringsDispPtr;

namespace Kgaxlib_tlb
{

// *********************************************************************//
// HelpString: KGAX ActiveX Control module
// Version:    1.0
// *********************************************************************//


// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:        
//   Type Libraries     : LIBID_xxxx                                      
//   CoClasses          : CLSID_xxxx                                      
//   DISPInterfaces     : DIID_xxxx                                       
//   Non-DISP interfaces: IID_xxxx                                        
// *********************************************************************//
extern __declspec (package) const GUID LIBID_KGAXLib;
extern __declspec (package) const GUID GUID_KZoomType;
extern __declspec (package) const GUID GUID_KDocumentType;
extern __declspec (package) const GUID GUID_KDocument3DDrawMode;
extern __declspec (package) const GUID GUID_KLibManagerMode;
extern __declspec (package) const GUID DIID_PaintObject;
extern __declspec (package) const GUID DIID_GLObject;
extern __declspec (package) const GUID DIID_GabaritObject;
extern __declspec (package) const GUID DIID__DKGAX;
extern __declspec (package) const GUID DIID__DKGAXEvents;
extern __declspec (package) const GUID CLSID_KGAX;

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
enum      KZoomType;
enum      KDocumentType;
enum      KDocument3DDrawMode;
enum      KLibManagerMode;
interface DECLSPEC_UUID("{89D7DB83-B61E-4A0A-8317-CE2481FFF4BA}") PaintObject;
typedef TComInterface<PaintObject, &DIID_PaintObject> PaintObjectPtr;
interface DECLSPEC_UUID("{89D7DB83-B61E-4A0A-8317-CE2481FFF4BB}") GLObject;
typedef TComInterface<GLObject, &DIID_GLObject> GLObjectPtr;
interface DECLSPEC_UUID("{89D7DB83-B61E-4A0A-8317-CE2481FFF4BC}") GabaritObject;
typedef TComInterface<GabaritObject, &DIID_GabaritObject> GabaritObjectPtr;
interface DECLSPEC_UUID("{92B3A942-4E70-463B-9462-6424D9CE40CB}") _DKGAX;
typedef TComInterface<_DKGAX, &DIID__DKGAX> _DKGAXPtr;
interface DECLSPEC_UUID("{464F746A-AC6D-4919-82E9-A7363E661ECF}") _DKGAXEvents;
typedef TComInterface<_DKGAXEvents, &DIID__DKGAXEvents> _DKGAXEventsPtr;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                       
// (NOTE: Here we map each CoClass to its Default Interface)              
//                                                                        
// The LIBID_OF_ macro(s) map a LIBID_OF_CoClassName to the GUID of this  
// TypeLibrary. It simplifies the updating of macros when CoClass name    
// change.                                                                
// *********************************************************************//
typedef _DKGAX KGAX;
typedef _DKGAXPtr KGAXPtr;

#define LIBID_OF_KGAX (&LIBID_KGAXLib)

// *********************************************************************//
// Declaration of Enumerations defined in Type Library                    
// *********************************************************************//
typedef enum KZoomType
{
  vt_ZoomWindow = 1, 
  vt_ZoomIn = 2, 
  vt_ZoomOut = 3, 
  vt_ZoomSelected = 4, 
  vt_ZoomEntureDocument = 5, 
  vt_Refresh = 6
} KZoomType;

typedef enum KDocumentType
{
  vt_SheetStandart = 1, 
  vt_SheetUser = 2, 
  vt_Fragment = 3, 
  vt_Spc = 4, 
  vt_3DPart = 5, 
  vt_3DAssembly = 6, 
  vt_TextStandart = 7, 
  vt_TextUser = 8, 
  vt_SpcUser = 9
} KDocumentType;

typedef enum KDocument3DDrawMode
{
  vt_WireframeMode = 0, 
  vt_HiddenRemovedMode = 1, 
  vt_HiddenThinMode = 2, 
  vt_ShadedMode = 3
} KDocument3DDrawMode;

typedef enum KLibManagerMode
{
  vt_MainLibManager = 0xFFFFFFFF, 
  vt_Default = 0, 
  vt_CurrentLibManager = 1
} KLibManagerMode;

// *********************************************************************//
// Interface: PaintObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BA}
// *********************************************************************//
interface PaintObject : public TDispWrapper<IDispatch>
{
  OLE_HANDLE __fastcall GetHWND()
  {
    _TDispID _dispid(/* GetHWND */ DISPID(1));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  OLE_HANDLE __fastcall GetDC()
  {
    _TDispID _dispid(/* GetDC */ DISPID(2));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall ReleaseDC(OLE_HANDLE dc/*[in]*/)
  {
    _TDispID _dispid(/* ReleaseDC */ DISPID(3));
    TAutoArgs<1> _args;
    _args[1] = dc /*[VT_INT:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall GetTransformMatrix(double* a11/*[out]*/, double* a12/*[out]*/, 
                                         double* a13/*[out]*/, double* a14/*[out]*/, 
                                         double* a21/*[out]*/, double* a22/*[out]*/, 
                                         double* a23/*[out]*/, double* a24/*[out]*/)
  {
    _TDispID _dispid(/* GetTransformMatrix */ DISPID(4));
    TAutoArgs<8> _args;
    _args[1] = a11 /*[VT_R8:1]*/;
    _args[2] = a12 /*[VT_R8:1]*/;
    _args[3] = a13 /*[VT_R8:1]*/;
    _args[4] = a14 /*[VT_R8:1]*/;
    _args[5] = a21 /*[VT_R8:1]*/;
    _args[6] = a22 /*[VT_R8:1]*/;
    _args[7] = a23 /*[VT_R8:1]*/;
    _args[8] = a24 /*[VT_R8:1]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }


};
// *********************************************************************//
// Interface: GLObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BB}
// *********************************************************************//
interface GLObject : public TDispWrapper<IDispatch>
{
  TOLEBOOL __fastcall glBegin(long mode/*[in]*/)
  {
    _TDispID _dispid(/* glBegin */ DISPID(1));
    TAutoArgs<1> _args;
    _args[1] = mode /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glEnd()
  {
    _TDispID _dispid(/* glEnd */ DISPID(2));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glEnable(long cap/*[in]*/)
  {
    _TDispID _dispid(/* glEnable */ DISPID(3));
    TAutoArgs<1> _args;
    _args[1] = cap /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glDisable(long cap/*[in]*/)
  {
    _TDispID _dispid(/* glDisable */ DISPID(4));
    TAutoArgs<1> _args;
    _args[1] = cap /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glColor3d(double r/*[in]*/, double g/*[in]*/, double b/*[in]*/)
  {
    _TDispID _dispid(/* glColor3d */ DISPID(20));
    TAutoArgs<3> _args;
    _args[1] = r /*[VT_R8:0]*/;
    _args[2] = g /*[VT_R8:0]*/;
    _args[3] = b /*[VT_R8:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glLineWidth(double w/*[in]*/)
  {
    _TDispID _dispid(/* glLineWidth */ DISPID(21));
    TAutoArgs<1> _args;
    _args[1] = w /*[VT_R8:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glLineStipple(long factor/*[in]*/, short pattern/*[in]*/)
  {
    _TDispID _dispid(/* glLineStipple */ DISPID(22));
    TAutoArgs<2> _args;
    _args[1] = factor /*[VT_I4:0]*/;
    _args[2] = pattern /*[VT_I2:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glPointSize(double w/*[in]*/)
  {
    _TDispID _dispid(/* glPointSize */ DISPID(23));
    TAutoArgs<1> _args;
    _args[1] = w /*[VT_R8:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glPolygonMode(long face/*[in]*/, long mode/*[in]*/)
  {
    _TDispID _dispid(/* glPolygonMode */ DISPID(24));
    TAutoArgs<2> _args;
    _args[1] = face /*[VT_I4:0]*/;
    _args[2] = mode /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glVertex2d(double x/*[in]*/, double y/*[in]*/)
  {
    _TDispID _dispid(/* glVertex2d */ DISPID(40));
    TAutoArgs<2> _args;
    _args[1] = x /*[VT_R8:0]*/;
    _args[2] = y /*[VT_R8:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glVertex2dv(double* pData/*[in]*/, long countDouble/*[in]*/)
  {
    _TDispID _dispid(/* glVertex2dv */ DISPID(41));
    TAutoArgs<2> _args;
    _args[1] = pData /*[VT_R8:1]*/;
    _args[2] = countDouble /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glVertex3d(double x/*[in]*/, double y/*[in]*/, double z/*[in]*/)
  {
    _TDispID _dispid(/* glVertex3d */ DISPID(42));
    TAutoArgs<3> _args;
    _args[1] = x /*[VT_R8:0]*/;
    _args[2] = y /*[VT_R8:0]*/;
    _args[3] = z /*[VT_R8:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glVertex3dv(double* pData/*[in]*/, long countDouble/*[in]*/)
  {
    _TDispID _dispid(/* glVertex3dv */ DISPID(43));
    TAutoArgs<2> _args;
    _args[1] = pData /*[VT_R8:1]*/;
    _args[2] = countDouble /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glVertex4d(double x/*[in]*/, double y/*[in]*/, double z/*[in]*/, 
                                 double w/*[in]*/)
  {
    _TDispID _dispid(/* glVertex4d */ DISPID(44));
    TAutoArgs<4> _args;
    _args[1] = x /*[VT_R8:0]*/;
    _args[2] = y /*[VT_R8:0]*/;
    _args[3] = z /*[VT_R8:0]*/;
    _args[4] = w /*[VT_R8:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall glVertex4dv(double* pData/*[in]*/, long countDouble/*[in]*/)
  {
    _TDispID _dispid(/* glVertex4dv */ DISPID(45));
    TAutoArgs<2> _args;
    _args[1] = pData /*[VT_R8:1]*/;
    _args[2] = countDouble /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }


};
// *********************************************************************//
// Interface: GabaritObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BC}
// *********************************************************************//
interface GabaritObject : public TDispWrapper<IDispatch>
{
  TOLEBOOL __fastcall AddGabarit(double p1X/*[in]*/, double p1Y/*[in]*/, double p1Z/*[in]*/, 
                                 double p2X/*[in]*/, double p2Y/*[in]*/, double p2Z/*[in]*/)
  {
    _TDispID _dispid(/* AddGabarit */ DISPID(1));
    TAutoArgs<6> _args;
    _args[1] = p1X /*[VT_R8:0]*/;
    _args[2] = p1Y /*[VT_R8:0]*/;
    _args[3] = p1Z /*[VT_R8:0]*/;
    _args[4] = p2X /*[VT_R8:0]*/;
    _args[5] = p2Y /*[VT_R8:0]*/;
    _args[6] = p2Z /*[VT_R8:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }


};
// *********************************************************************//
// Interface: _DKGAX
// Flags:     (4112) Hidden Dispatchable
// GUID:      {92B3A942-4E70-463B-9462-6424D9CE40CB}
// *********************************************************************//
interface _DKGAX : public TDispWrapper<IDispatch>
{
  void __fastcall set_Caption(BSTR /*[VT_BSTR:0]*/ Value)
  {
    _TDispID _dispid(/* Caption */ DISPID(-518));
    TAutoArgs<1> _args;
    _args[1] = Value;
    OlePropertyPut(_dispid, _args);
  }

  BSTR /*[VT_BSTR:0]*/ __fastcall get_Caption()
  {
    _TDispID _dispid(/* Caption */ DISPID(-518));
    TAutoArgs<0> _args;
    OlePropertyGet(_dispid, _args);
    return _args.GetRetVariant();
  }

  void __fastcall set_Text(BSTR /*[VT_BSTR:0]*/ Value)
  {
    _TDispID _dispid(/* Text */ DISPID(-517));
    TAutoArgs<1> _args;
    _args[1] = Value;
    OlePropertyPut(_dispid, _args);
  }

  BSTR /*[VT_BSTR:0]*/ __fastcall get_Text()
  {
    _TDispID _dispid(/* Text */ DISPID(-517));
    TAutoArgs<0> _args;
    OlePropertyGet(_dispid, _args);
    return _args.GetRetVariant();
  }

  void __fastcall set_DocumentType(Kgaxlib_tlb::KDocumentType /*[VT_USERDEFINED:0]*/ Value)
  {
    _TDispID _dispid(/* DocumentType */ DISPID(1));
    TAutoArgs<1> _args;
    _args[1] = (int) /*[VT_I4:0]*/ (Kgaxlib_tlb::KDocumentType /*[C2]*/)Value;
    OlePropertyPut(_dispid, _args);
  }

  Kgaxlib_tlb::KDocumentType /*[VT_USERDEFINED:0]*/ __fastcall get_DocumentType()
  {
    _TDispID _dispid(/* DocumentType */ DISPID(1));
    TAutoArgs<0> _args;
    OlePropertyGet(_dispid, _args);
    return (Kgaxlib_tlb::KDocumentType /*[C3]*/)(int)_args.GetRetVariant();
  }

  void __fastcall set_DocumenFileName(BSTR /*[VT_BSTR:0]*/ Value)
  {
    _TDispID _dispid(/* DocumenFileName */ DISPID(2));
    TAutoArgs<1> _args;
    _args[1] = Value;
    OlePropertyPut(_dispid, _args);
  }

  BSTR /*[VT_BSTR:0]*/ __fastcall get_DocumenFileName()
  {
    _TDispID _dispid(/* DocumenFileName */ DISPID(2));
    TAutoArgs<0> _args;
    OlePropertyGet(_dispid, _args);
    return _args.GetRetVariant();
  }

  void __fastcall set_Document3DDrawMode(Kgaxlib_tlb::KDocument3DDrawMode /*[VT_USERDEFINED:0]*/ Value)
  {
    _TDispID _dispid(/* Document3DDrawMode */ DISPID(3));
    TAutoArgs<1> _args;
    _args[1] = (int) /*[VT_I4:0]*/ (Kgaxlib_tlb::KDocument3DDrawMode /*[C2]*/)Value;
    OlePropertyPut(_dispid, _args);
  }

  Kgaxlib_tlb::KDocument3DDrawMode /*[VT_USERDEFINED:0]*/ __fastcall get_Document3DDrawMode()
  {
    _TDispID _dispid(/* Document3DDrawMode */ DISPID(3));
    TAutoArgs<0> _args;
    OlePropertyGet(_dispid, _args);
    return (Kgaxlib_tlb::KDocument3DDrawMode /*[C3]*/)(int)_args.GetRetVariant();
  }

  void __fastcall set_Document3DWireframeShadedMode(TOLEBOOL /*[VT_BOOL:0]*/ Value)
  {
    _TDispID _dispid(/* Document3DWireframeShadedMode */ DISPID(4));
    TAutoArgs<1> _args;
    _args[1] = Value;
    OlePropertyPut(_dispid, _args);
  }

  TOLEBOOL /*[VT_BOOL:0]*/ __fastcall get_Document3DWireframeShadedMode()
  {
    _TDispID _dispid(/* Document3DWireframeShadedMode */ DISPID(4));
    TAutoArgs<0> _args;
    OlePropertyGet(_dispid, _args);
    return _args.GetRetVariant();
  }

  Ks_tlb::KompasObjectPtr __fastcall GetKompasObject()
  {
    _TDispID _dispid(/* GetKompasObject */ DISPID(5));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return (Ks_tlb::KompasObject* /*[C1]*/)(LPDISPATCH) /*[VT_DISPATCH:1]*/_args.GetRetVariant();
  }

  Kgaxlib_tlb::KDocumentType __fastcall GetDocumentType(OleVariant index/*[in]*/)
  {
    _TDispID _dispid(/* GetDocumentType */ DISPID(6));
    TAutoArgs<1> _args;
    _args[1] = index /*[VT_VARIANT:0]*/;
    OleFunction(_dispid, _args);
    return (Kgaxlib_tlb::KDocumentType /*[C1]*/)(int) /*[VT_I4:0]*/_args.GetRetVariant();
  }

  LPDISPATCH __fastcall GetDocumentInterface(OleVariant index/*[in]*/, long newAPI)
  {
    _TDispID _dispid(/* GetDocumentInterface */ DISPID(7));
    TAutoArgs<2> _args;
    _args[1] = index /*[VT_VARIANT:0]*/;
    _args[2] = newAPI /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  long __fastcall GetActiveDocumentID()
  {
    _TDispID _dispid(/* GetActiveDocumentID */ DISPID(8));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  long __fastcall GetDocumentsCount()
  {
    _TDispID _dispid(/* GetDocumentsCount */ DISPID(9));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  long __fastcall AddDocument(BSTR fileName/*[in]*/)
  {
    _TDispID _dispid(/* AddDocument */ DISPID(10));
    TAutoArgs<1> _args;
    _args[1] = fileName /*[VT_BSTR:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  long __fastcall AddNewDocument(Kgaxlib_tlb::KDocumentType type/*[in]*/)
  {
    _TDispID _dispid(/* AddNewDocument */ DISPID(11));
    TAutoArgs<1> _args;
    _args[1] = (int)type /*[VT_USERDEFINED:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  long __fastcall InsertDocument(BSTR fileName/*[in]*/, OleVariant index/*[in]*/)
  {
    _TDispID _dispid(/* InsertDocument */ DISPID(12));
    TAutoArgs<2> _args;
    _args[1] = fileName /*[VT_BSTR:0]*/;
    _args[2] = index /*[VT_VARIANT:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  long __fastcall InsertNewDocument(Kgaxlib_tlb::KDocumentType type/*[in]*/, 
                                    OleVariant index/*[in]*/)
  {
    _TDispID _dispid(/* InsertNewDocument */ DISPID(13));
    TAutoArgs<2> _args;
    _args[1] = (int)type /*[VT_USERDEFINED:0]*/;
    _args[2] = index /*[VT_VARIANT:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall RemoveDocument(OleVariant index/*[in]*/)
  {
    _TDispID _dispid(/* RemoveDocument */ DISPID(14));
    TAutoArgs<1> _args;
    _args[1] = index /*[VT_VARIANT:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall ActivateDocument(OleVariant index/*[in]*/)
  {
    _TDispID _dispid(/* ActivateDocument */ DISPID(15));
    TAutoArgs<1> _args;
    _args[1] = index /*[VT_VARIANT:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  long __fastcall CloseAll()
  {
    _TDispID _dispid(/* CloseAll */ DISPID(16));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  int __fastcall TestLoadDocument(BSTR fileName/*[in]*/)
  {
    _TDispID _dispid(/* TestLoadDocument */ DISPID(17));
    TAutoArgs<1> _args;
    _args[1] = fileName /*[VT_BSTR:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  TOLEBOOL __fastcall InvalidateActiveDocument(TOLEBOOL erase/*[in]*/)
  {
    _TDispID _dispid(/* InvalidateActiveDocument */ DISPID(18));
    TAutoArgs<1> _args;
    _args[1] = erase /*[VT_BOOL:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  void __fastcall ZoomEntireDocument()
  {
    _TDispID _dispid(/* ZoomEntireDocument */ DISPID(19));
    OleProcedure(_dispid);
  }

  void __fastcall MoveViewDocument()
  {
    _TDispID _dispid(/* MoveViewDocument */ DISPID(20));
    OleProcedure(_dispid);
  }

  void __fastcall PanoramaViewDocument()
  {
    _TDispID _dispid(/* PanoramaViewDocument */ DISPID(21));
    OleProcedure(_dispid);
  }

  void __fastcall RotateViewDocument()
  {
    _TDispID _dispid(/* RotateViewDocument */ DISPID(22));
    OleProcedure(_dispid);
  }

  void __fastcall OrientationDocument()
  {
    _TDispID _dispid(/* OrientationDocument */ DISPID(23));
    OleProcedure(_dispid);
  }

  void __fastcall ZoomWindow(Kgaxlib_tlb::KZoomType type/*[in,def,opt]*/)
  {
    _TDispID _dispid(/* ZoomWindow */ DISPID(24));
    TAutoArgs<1> _args;
    _args[1] = (int)type /*[VT_USERDEFINED:0]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall StopCurrentProcess(TOLEBOOL cancel/*[in,def,opt]*/)
  {
    _TDispID _dispid(/* StopCurrentProcess */ DISPID(25));
    TAutoArgs<1> _args;
    _args[1] = cancel /*[VT_BOOL:0]*/;
    OleProcedure(_dispid, _args);
  }

  TOLEBOOL __fastcall DrawToDC(OLE_HANDLE dc/*[in]*/, long left/*[in]*/, long top/*[in]*/, 
                               long width/*[in]*/, long height/*[in]*/)
  {
    _TDispID _dispid(/* DrawToDC */ DISPID(26));
    TAutoArgs<5> _args;
    _args[1] = dc /*[VT_INT:0]*/;
    _args[2] = left /*[VT_I4:0]*/;
    _args[3] = top /*[VT_I4:0]*/;
    _args[4] = width /*[VT_I4:0]*/;
    _args[5] = height /*[VT_I4:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  void __fastcall SetCurrentLibManager(long t/*[in]*/)
  {
    _TDispID _dispid(/* SetCurrentLibManager */ DISPID(27));
    TAutoArgs<1> _args;
    _args[1] = t /*[VT_I4:0]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall SetGabaritModifying()
  {
    _TDispID _dispid(/* SetGabaritModifying */ DISPID(28));
    OleProcedure(_dispid);
  }

  long __fastcall GetDocumentID(OleVariant index/*[in]*/)
  {
    _TDispID _dispid(/* GetDocumentID */ DISPID(29));
    TAutoArgs<1> _args;
    _args[1] = index /*[VT_VARIANT:0]*/;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }


  __property   BSTR            Caption = {read = get_Caption, write = set_Caption};
  __property   BSTR            Text = {read = get_Text, write = set_Text};
  __property   Kgaxlib_tlb::KDocumentType DocumentType = {read = get_DocumentType, write = set_DocumentType};
  __property   BSTR            DocumenFileName = {read = get_DocumenFileName, write = set_DocumenFileName};
  __property   Kgaxlib_tlb::KDocument3DDrawMode Document3DDrawMode = {read = get_Document3DDrawMode, write = set_Document3DDrawMode};
  __property   TOLEBOOL        Document3DWireframeShadedMode = {read = get_Document3DWireframeShadedMode, write = set_Document3DWireframeShadedMode};
};
// *********************************************************************//
// Interface: _DKGAXEvents
// Flags:     (4096) Dispatchable
// GUID:      {464F746A-AC6D-4919-82E9-A7363E661ECF}
// *********************************************************************//
interface _DKGAXEvents : public TDispWrapper<IDispatch>
{
  void __fastcall OnKgMouseDown(short nButton/*[in]*/, short nShiftState/*[in]*/, long x/*[in]*/, 
                                long y/*[in]*/, TOLEBOOL* proceed/*[out]*/)
  {
    _TDispID _dispid(/* OnKgMouseDown */ DISPID(1));
    TAutoArgs<5> _args;
    _args[1] = nButton /*[VT_I2:0]*/;
    _args[2] = nShiftState /*[VT_I2:0]*/;
    _args[3] = x /*[VT_I4:0]*/;
    _args[4] = y /*[VT_I4:0]*/;
    _args[5] = proceed /*[VT_BOOL:1]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgMouseUp(short nButton/*[in]*/, short nShiftState/*[in]*/, long x/*[in]*/, 
                              long y/*[in]*/, TOLEBOOL* proceed/*[out]*/)
  {
    _TDispID _dispid(/* OnKgMouseUp */ DISPID(2));
    TAutoArgs<5> _args;
    _args[1] = nButton /*[VT_I2:0]*/;
    _args[2] = nShiftState /*[VT_I2:0]*/;
    _args[3] = x /*[VT_I4:0]*/;
    _args[4] = y /*[VT_I4:0]*/;
    _args[5] = proceed /*[VT_BOOL:1]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgMouseDblClick(short nButton/*[in]*/, short nShiftState/*[in]*/, long x/*[in]*/
                                    , long y/*[in]*/, TOLEBOOL* proceed/*[out]*/)
  {
    _TDispID _dispid(/* OnKgMouseDblClick */ DISPID(3));
    TAutoArgs<5> _args;
    _args[1] = nButton /*[VT_I2:0]*/;
    _args[2] = nShiftState /*[VT_I2:0]*/;
    _args[3] = x /*[VT_I4:0]*/;
    _args[4] = y /*[VT_I4:0]*/;
    _args[5] = proceed /*[VT_BOOL:1]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgStopCurrentProcess()
  {
    _TDispID _dispid(/* OnKgStopCurrentProcess */ DISPID(4));
    OleProcedure(_dispid);
  }

  void __fastcall OnKgCreate(long docID/*[in]*/)
  {
    _TDispID _dispid(/* OnKgCreate */ DISPID(5));
    TAutoArgs<1> _args;
    _args[1] = docID /*[VT_I4:0]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgPaint(Kgaxlib_tlb::PaintObjectPtr paintObj/*[in]*/)
  {
    _TDispID _dispid(/* OnKgPaint */ DISPID(6));
    TAutoArgs<1> _args;
    _args[1] = (LPDISPATCH)(Kgaxlib_tlb::PaintObject*)paintObj /*[VT_USERDEFINED:1]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgCreateGLList(Kgaxlib_tlb::GLObjectPtr glObj/*[in]*/, 
                                   Kgaxlib_tlb::KDocument3DDrawMode drawMode/*[in]*/)
  {
    _TDispID _dispid(/* OnKgCreateGLList */ DISPID(7));
    TAutoArgs<2> _args;
    _args[1] = (LPDISPATCH)(Kgaxlib_tlb::GLObject*)glObj /*[VT_USERDEFINED:1]*/;
    _args[2] = (int)drawMode /*[VT_USERDEFINED:0]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgAddGabatit(Kgaxlib_tlb::GabaritObjectPtr gabObj/*[in]*/)
  {
    _TDispID _dispid(/* OnKgAddGabatit */ DISPID(8));
    TAutoArgs<1> _args;
    _args[1] = (LPDISPATCH)(Kgaxlib_tlb::GabaritObject*)gabObj /*[VT_USERDEFINED:1]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgErrorLoadDocument(long docID/*[in]*/, BSTR fileName/*[in]*/, 
                                        long errorID/*[in]*/)
  {
    _TDispID _dispid(/* OnKgErrorLoadDocument */ DISPID(9));
    TAutoArgs<3> _args;
    _args[1] = docID /*[VT_I4:0]*/;
    _args[2] = fileName /*[VT_BSTR:0]*/;
    _args[3] = errorID /*[VT_I4:0]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgKeyDown(long* key/*[in,out]*/, short nShiftState/*[in]*/)
  {
    _TDispID _dispid(/* OnKgKeyDown */ DISPID(10));
    TAutoArgs<2> _args;
    _args[1] = key /*[VT_I4:1]*/;
    _args[2] = nShiftState /*[VT_I2:0]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgKeyUp(long* key/*[in,out]*/, short nShiftState/*[in]*/)
  {
    _TDispID _dispid(/* OnKgKeyUp */ DISPID(11));
    TAutoArgs<2> _args;
    _args[1] = key /*[VT_I4:1]*/;
    _args[2] = nShiftState /*[VT_I2:0]*/;
    OleProcedure(_dispid, _args);
  }

  void __fastcall OnKgKeyPress(long* key/*[in,out]*/)
  {
    _TDispID _dispid(/* OnKgKeyPress */ DISPID(12));
    TAutoArgs<1> _args;
    _args[1] = key /*[VT_I4:1]*/;
    OleProcedure(_dispid, _args);
  }


};
#if !defined(__TLB_NO_INTERFACE_WRAPPERS)
// *********************************************************************//
// DispIntf:  PaintObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BA}
// *********************************************************************//
template<class T>
class PaintObjectDispT : public TAutoDriver<PaintObject>
{
public:
  PaintObjectDispT(){}

  PaintObjectDispT(PaintObject *pintf)
  {
    TAutoDriver<PaintObject>::Bind(pintf, false);
  }

  PaintObjectDispT(PaintObjectPtr pintf)
  {
    TAutoDriver<PaintObject>::Bind(pintf, true);
  }

  PaintObjectDispT& operator=(PaintObject *pintf)
  {
    TAutoDriver<PaintObject>::Bind(pintf, false);
    return *this;
  }

  PaintObjectDispT& operator=(PaintObjectPtr pintf)
  {
    TAutoDriver<PaintObject>::Bind(pintf, true);
    return *this;
  }

  OLE_HANDLE      __fastcall GetHWND();
  OLE_HANDLE      __fastcall GetDC();
  TOLEBOOL        __fastcall ReleaseDC(OLE_HANDLE dc/*[in]*/);
  TOLEBOOL        __fastcall GetTransformMatrix(double* a11/*[out]*/, double* a12/*[out]*/, 
                                                double* a13/*[out]*/, double* a14/*[out]*/, 
                                                double* a21/*[out]*/, double* a22/*[out]*/, 
                                                double* a23/*[out]*/, double* a24/*[out]*/);

};
typedef PaintObjectDispT<PaintObject> PaintObjectDisp;

// *********************************************************************//
// DispIntf:  GLObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BB}
// *********************************************************************//
template<class T>
class GLObjectDispT : public TAutoDriver<GLObject>
{
public:
  GLObjectDispT(){}

  GLObjectDispT(GLObject *pintf)
  {
    TAutoDriver<GLObject>::Bind(pintf, false);
  }

  GLObjectDispT(GLObjectPtr pintf)
  {
    TAutoDriver<GLObject>::Bind(pintf, true);
  }

  GLObjectDispT& operator=(GLObject *pintf)
  {
    TAutoDriver<GLObject>::Bind(pintf, false);
    return *this;
  }

  GLObjectDispT& operator=(GLObjectPtr pintf)
  {
    TAutoDriver<GLObject>::Bind(pintf, true);
    return *this;
  }

  TOLEBOOL        __fastcall glBegin(long mode/*[in]*/);
  TOLEBOOL        __fastcall glEnd();
  TOLEBOOL        __fastcall glEnable(long cap/*[in]*/);
  TOLEBOOL        __fastcall glDisable(long cap/*[in]*/);
  TOLEBOOL        __fastcall glColor3d(double r/*[in]*/, double g/*[in]*/, double b/*[in]*/);
  TOLEBOOL        __fastcall glLineWidth(double w/*[in]*/);
  TOLEBOOL        __fastcall glLineStipple(long factor/*[in]*/, short pattern/*[in]*/);
  TOLEBOOL        __fastcall glPointSize(double w/*[in]*/);
  TOLEBOOL        __fastcall glPolygonMode(long face/*[in]*/, long mode/*[in]*/);
  TOLEBOOL        __fastcall glVertex2d(double x/*[in]*/, double y/*[in]*/);
  TOLEBOOL        __fastcall glVertex2dv(double* pData/*[in]*/, long countDouble/*[in]*/);
  TOLEBOOL        __fastcall glVertex3d(double x/*[in]*/, double y/*[in]*/, double z/*[in]*/);
  TOLEBOOL        __fastcall glVertex3dv(double* pData/*[in]*/, long countDouble/*[in]*/);
  TOLEBOOL        __fastcall glVertex4d(double x/*[in]*/, double y/*[in]*/, double z/*[in]*/, 
                                        double w/*[in]*/);
  TOLEBOOL        __fastcall glVertex4dv(double* pData/*[in]*/, long countDouble/*[in]*/);

};
typedef GLObjectDispT<GLObject> GLObjectDisp;

// *********************************************************************//
// DispIntf:  GabaritObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BC}
// *********************************************************************//
template<class T>
class GabaritObjectDispT : public TAutoDriver<GabaritObject>
{
public:
  GabaritObjectDispT(){}

  GabaritObjectDispT(GabaritObject *pintf)
  {
    TAutoDriver<GabaritObject>::Bind(pintf, false);
  }

  GabaritObjectDispT(GabaritObjectPtr pintf)
  {
    TAutoDriver<GabaritObject>::Bind(pintf, true);
  }

  GabaritObjectDispT& operator=(GabaritObject *pintf)
  {
    TAutoDriver<GabaritObject>::Bind(pintf, false);
    return *this;
  }

  GabaritObjectDispT& operator=(GabaritObjectPtr pintf)
  {
    TAutoDriver<GabaritObject>::Bind(pintf, true);
    return *this;
  }

  TOLEBOOL        __fastcall AddGabarit(double p1X/*[in]*/, double p1Y/*[in]*/, double p1Z/*[in]*/, 
                                        double p2X/*[in]*/, double p2Y/*[in]*/, double p2Z/*[in]*/);

};
typedef GabaritObjectDispT<GabaritObject> GabaritObjectDisp;

// *********************************************************************//
// DispIntf:  _DKGAX
// Flags:     (4112) Hidden Dispatchable
// GUID:      {92B3A942-4E70-463B-9462-6424D9CE40CB}
// *********************************************************************//
template<class T>
class _DKGAXDispT : public TAutoDriver<_DKGAX>
{
public:
  _DKGAXDispT(){}

  _DKGAXDispT(_DKGAX *pintf)
  {
    TAutoDriver<_DKGAX>::Bind(pintf, false);
  }

  _DKGAXDispT(_DKGAXPtr pintf)
  {
    TAutoDriver<_DKGAX>::Bind(pintf, true);
  }

  _DKGAXDispT& operator=(_DKGAX *pintf)
  {
    TAutoDriver<_DKGAX>::Bind(pintf, false);
    return *this;
  }

  _DKGAXDispT& operator=(_DKGAXPtr pintf)
  {
    TAutoDriver<_DKGAX>::Bind(pintf, true);
    return *this;
  }

  HRESULT BindDefault()
  {
    return OLECHECK(Bind(CLSID_KGAX));
  }

  HRESULT BindRunning()
  {
    return BindToActive(CLSID_KGAX);
  }

  void            __fastcall set_Caption(BSTR Value);
  BSTR            __fastcall get_Caption();
  void            __fastcall set_Text(BSTR Value);
  BSTR            __fastcall get_Text();
  void            __fastcall set_DocumentType(Kgaxlib_tlb::KDocumentType Value);
  Kgaxlib_tlb::KDocumentType __fastcall get_DocumentType();
  void            __fastcall set_DocumenFileName(BSTR Value);
  BSTR            __fastcall get_DocumenFileName();
  void            __fastcall set_Document3DDrawMode(Kgaxlib_tlb::KDocument3DDrawMode Value);
  Kgaxlib_tlb::KDocument3DDrawMode __fastcall get_Document3DDrawMode();
  void            __fastcall set_Document3DWireframeShadedMode(TOLEBOOL Value);
  TOLEBOOL        __fastcall get_Document3DWireframeShadedMode();
  Ks_tlb::KompasObjectPtr __fastcall GetKompasObject();
  Kgaxlib_tlb::KDocumentType __fastcall GetDocumentType(OleVariant index/*[in]*/);
  LPDISPATCH      __fastcall GetDocumentInterface(OleVariant index/*[in]*/, long newAPI);
  long            __fastcall GetActiveDocumentID();
  long            __fastcall GetDocumentsCount();
  long            __fastcall AddDocument(BSTR fileName/*[in]*/);
  long            __fastcall AddNewDocument(Kgaxlib_tlb::KDocumentType type/*[in]*/);
  long            __fastcall InsertDocument(BSTR fileName/*[in]*/, OleVariant index/*[in]*/);
  long            __fastcall InsertNewDocument(Kgaxlib_tlb::KDocumentType type/*[in]*/, 
                                               OleVariant index/*[in]*/);
  TOLEBOOL        __fastcall RemoveDocument(OleVariant index/*[in]*/);
  TOLEBOOL        __fastcall ActivateDocument(OleVariant index/*[in]*/);
  long            __fastcall CloseAll();
  int             __fastcall TestLoadDocument(BSTR fileName/*[in]*/);
  TOLEBOOL        __fastcall InvalidateActiveDocument(TOLEBOOL erase/*[in]*/);
  void            __fastcall ZoomEntireDocument();
  void            __fastcall MoveViewDocument();
  void            __fastcall PanoramaViewDocument();
  void            __fastcall RotateViewDocument();
  void            __fastcall OrientationDocument();
  void            __fastcall ZoomWindow(Kgaxlib_tlb::KZoomType type/*[in,def,opt]*/);
  void            __fastcall StopCurrentProcess(TOLEBOOL cancel/*[in,def,opt]*/);
  TOLEBOOL        __fastcall DrawToDC(OLE_HANDLE dc/*[in]*/, long left/*[in]*/, long top/*[in]*/, 
                                      long width/*[in]*/, long height/*[in]*/);
  void            __fastcall SetCurrentLibManager(long t/*[in]*/);
  void            __fastcall SetGabaritModifying();
  long            __fastcall GetDocumentID(OleVariant index/*[in]*/);

  __property   BSTR            Caption = {read = get_Caption, write = set_Caption};
  __property   BSTR            Text = {read = get_Text, write = set_Text};
  __property   Kgaxlib_tlb::KDocumentType DocumentType = {read = get_DocumentType, write = set_DocumentType};
  __property   BSTR            DocumenFileName = {read = get_DocumenFileName, write = set_DocumenFileName};
  __property   Kgaxlib_tlb::KDocument3DDrawMode Document3DDrawMode = {read = get_Document3DDrawMode, write = set_Document3DDrawMode};
  __property   TOLEBOOL        Document3DWireframeShadedMode = {read = get_Document3DWireframeShadedMode, write = set_Document3DWireframeShadedMode};
};
typedef _DKGAXDispT<_DKGAX> _DKGAXDisp;

// *********************************************************************//
// DispIntf:  _DKGAXEvents
// Flags:     (4096) Dispatchable
// GUID:      {464F746A-AC6D-4919-82E9-A7363E661ECF}
// *********************************************************************//
template <class T>
class _DKGAXEventsDispT : public TAutoDriver<_DKGAXEvents>
{
public:
  _DKGAXEventsDispT(){}

  void Attach(LPUNKNOWN punk)
  { m_Dispatch = static_cast<T*>(punk); }

  void            __fastcall OnKgMouseDown(short nButton/*[in]*/, short nShiftState/*[in]*/, 
                                           long x/*[in]*/, long y/*[in]*/, 
                                           TOLEBOOL* proceed/*[out]*/);
  void            __fastcall OnKgMouseUp(short nButton/*[in]*/, short nShiftState/*[in]*/, 
                                         long x/*[in]*/, long y/*[in]*/, TOLEBOOL* proceed/*[out]*/);
  void            __fastcall OnKgMouseDblClick(short nButton/*[in]*/, short nShiftState/*[in]*/, 
                                               long x/*[in]*/, long y/*[in]*/, 
                                               TOLEBOOL* proceed/*[out]*/);
  void            __fastcall OnKgStopCurrentProcess();
  void            __fastcall OnKgCreate(long docID/*[in]*/);
  void            __fastcall OnKgPaint(Kgaxlib_tlb::PaintObjectPtr paintObj/*[in]*/);
  void            __fastcall OnKgCreateGLList(Kgaxlib_tlb::GLObjectPtr glObj/*[in]*/, 
                                              Kgaxlib_tlb::KDocument3DDrawMode drawMode/*[in]*/);
  void            __fastcall OnKgAddGabatit(Kgaxlib_tlb::GabaritObjectPtr gabObj/*[in]*/);
  void            __fastcall OnKgErrorLoadDocument(long docID/*[in]*/, BSTR fileName/*[in]*/, 
                                                   long errorID/*[in]*/);
  void            __fastcall OnKgKeyDown(long* key/*[in,out]*/, short nShiftState/*[in]*/);
  void            __fastcall OnKgKeyUp(long* key/*[in,out]*/, short nShiftState/*[in]*/);
  void            __fastcall OnKgKeyPress(long* key/*[in,out]*/);

};
typedef _DKGAXEventsDispT<_DKGAXEvents> _DKGAXEventsDisp;

// *********************************************************************//
// DispIntf:  PaintObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BA}
// *********************************************************************//
template <class T> OLE_HANDLE __fastcall
PaintObjectDispT<T>::GetHWND()
{
  _TDispID _dispid(*this, OLETEXT("GetHWND"), DISPID(1));
  TAutoArgs<0> _args;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> OLE_HANDLE __fastcall
PaintObjectDispT<T>::GetDC()
{
  _TDispID _dispid(*this, OLETEXT("GetDC"), DISPID(2));
  TAutoArgs<0> _args;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
PaintObjectDispT<T>::ReleaseDC(OLE_HANDLE dc/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("ReleaseDC"), DISPID(3));
  TAutoArgs<1> _args;
  _args[1] = dc /*[VT_INT:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
PaintObjectDispT<T>::GetTransformMatrix(double* a11/*[out]*/, double* a12/*[out]*/, 
                                        double* a13/*[out]*/, double* a14/*[out]*/, 
                                        double* a21/*[out]*/, double* a22/*[out]*/, 
                                        double* a23/*[out]*/, double* a24/*[out]*/)
{
  _TDispID _dispid(*this, OLETEXT("GetTransformMatrix"), DISPID(4));
  TAutoArgs<8> _args;
  _args[1] = a11 /*[VT_R8:1]*/;
  _args[2] = a12 /*[VT_R8:1]*/;
  _args[3] = a13 /*[VT_R8:1]*/;
  _args[4] = a14 /*[VT_R8:1]*/;
  _args[5] = a21 /*[VT_R8:1]*/;
  _args[6] = a22 /*[VT_R8:1]*/;
  _args[7] = a23 /*[VT_R8:1]*/;
  _args[8] = a24 /*[VT_R8:1]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

// *********************************************************************//
// DispIntf:  GLObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BB}
// *********************************************************************//
template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glBegin(long mode/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glBegin"), DISPID(1));
  TAutoArgs<1> _args;
  _args[1] = mode /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glEnd()
{
  _TDispID _dispid(*this, OLETEXT("glEnd"), DISPID(2));
  TAutoArgs<0> _args;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glEnable(long cap/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glEnable"), DISPID(3));
  TAutoArgs<1> _args;
  _args[1] = cap /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glDisable(long cap/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glDisable"), DISPID(4));
  TAutoArgs<1> _args;
  _args[1] = cap /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glColor3d(double r/*[in]*/, double g/*[in]*/, double b/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glColor3d"), DISPID(20));
  TAutoArgs<3> _args;
  _args[1] = r /*[VT_R8:0]*/;
  _args[2] = g /*[VT_R8:0]*/;
  _args[3] = b /*[VT_R8:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glLineWidth(double w/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glLineWidth"), DISPID(21));
  TAutoArgs<1> _args;
  _args[1] = w /*[VT_R8:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glLineStipple(long factor/*[in]*/, short pattern/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glLineStipple"), DISPID(22));
  TAutoArgs<2> _args;
  _args[1] = factor /*[VT_I4:0]*/;
  _args[2] = pattern /*[VT_I2:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glPointSize(double w/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glPointSize"), DISPID(23));
  TAutoArgs<1> _args;
  _args[1] = w /*[VT_R8:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glPolygonMode(long face/*[in]*/, long mode/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glPolygonMode"), DISPID(24));
  TAutoArgs<2> _args;
  _args[1] = face /*[VT_I4:0]*/;
  _args[2] = mode /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glVertex2d(double x/*[in]*/, double y/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glVertex2d"), DISPID(40));
  TAutoArgs<2> _args;
  _args[1] = x /*[VT_R8:0]*/;
  _args[2] = y /*[VT_R8:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glVertex2dv(double* pData/*[in]*/, long countDouble/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glVertex2dv"), DISPID(41));
  TAutoArgs<2> _args;
  _args[1] = pData /*[VT_R8:1]*/;
  _args[2] = countDouble /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glVertex3d(double x/*[in]*/, double y/*[in]*/, double z/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glVertex3d"), DISPID(42));
  TAutoArgs<3> _args;
  _args[1] = x /*[VT_R8:0]*/;
  _args[2] = y /*[VT_R8:0]*/;
  _args[3] = z /*[VT_R8:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glVertex3dv(double* pData/*[in]*/, long countDouble/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glVertex3dv"), DISPID(43));
  TAutoArgs<2> _args;
  _args[1] = pData /*[VT_R8:1]*/;
  _args[2] = countDouble /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glVertex4d(double x/*[in]*/, double y/*[in]*/, double z/*[in]*/, double w/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glVertex4d"), DISPID(44));
  TAutoArgs<4> _args;
  _args[1] = x /*[VT_R8:0]*/;
  _args[2] = y /*[VT_R8:0]*/;
  _args[3] = z /*[VT_R8:0]*/;
  _args[4] = w /*[VT_R8:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
GLObjectDispT<T>::glVertex4dv(double* pData/*[in]*/, long countDouble/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("glVertex4dv"), DISPID(45));
  TAutoArgs<2> _args;
  _args[1] = pData /*[VT_R8:1]*/;
  _args[2] = countDouble /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

// *********************************************************************//
// DispIntf:  GabaritObject
// Flags:     (4096) Dispatchable
// GUID:      {89D7DB83-B61E-4A0A-8317-CE2481FFF4BC}
// *********************************************************************//
template <class T> TOLEBOOL __fastcall
GabaritObjectDispT<T>::AddGabarit(double p1X/*[in]*/, double p1Y/*[in]*/, double p1Z/*[in]*/, 
                                  double p2X/*[in]*/, double p2Y/*[in]*/, double p2Z/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("AddGabarit"), DISPID(1));
  TAutoArgs<6> _args;
  _args[1] = p1X /*[VT_R8:0]*/;
  _args[2] = p1Y /*[VT_R8:0]*/;
  _args[3] = p1Z /*[VT_R8:0]*/;
  _args[4] = p2X /*[VT_R8:0]*/;
  _args[5] = p2Y /*[VT_R8:0]*/;
  _args[6] = p2Z /*[VT_R8:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

// *********************************************************************//
// DispIntf:  _DKGAX
// Flags:     (4112) Hidden Dispatchable
// GUID:      {92B3A942-4E70-463B-9462-6424D9CE40CB}
// *********************************************************************//
template <class T> void __fastcall
_DKGAXDispT<T>::set_Caption(BSTR /*[VT_BSTR:0]*/ Value)
{
  _TDispID _dispid(*this, OLETEXT("Caption"), DISPID(-518));
  TAutoArgs<1> _args;
  _args[1] = Value;
  OlePropertyPut(_dispid, _args);
}

template <class T> BSTR /*[VT_BSTR:0]*/ __fastcall
_DKGAXDispT<T>::get_Caption()
{
  _TDispID _dispid(*this, OLETEXT("Caption"), DISPID(-518));
  TAutoArgs<0> _args;
  OlePropertyGet(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> void __fastcall
_DKGAXDispT<T>::set_Text(BSTR /*[VT_BSTR:0]*/ Value)
{
  _TDispID _dispid(*this, OLETEXT("Text"), DISPID(-517));
  TAutoArgs<1> _args;
  _args[1] = Value;
  OlePropertyPut(_dispid, _args);
}

template <class T> BSTR /*[VT_BSTR:0]*/ __fastcall
_DKGAXDispT<T>::get_Text()
{
  _TDispID _dispid(*this, OLETEXT("Text"), DISPID(-517));
  TAutoArgs<0> _args;
  OlePropertyGet(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> void __fastcall
_DKGAXDispT<T>::set_DocumentType(Kgaxlib_tlb::KDocumentType /*[VT_USERDEFINED:0]*/ Value)
{
  _TDispID _dispid(*this, OLETEXT("DocumentType"), DISPID(1));
  TAutoArgs<1> _args;
  _args[1] = (int) /*[VT_I4:0]*/ (Kgaxlib_tlb::KDocumentType /*[C2]*/)Value;
  OlePropertyPut(_dispid, _args);
}

template <class T> Kgaxlib_tlb::KDocumentType /*[VT_USERDEFINED:0]*/ __fastcall
_DKGAXDispT<T>::get_DocumentType()
{
  _TDispID _dispid(*this, OLETEXT("DocumentType"), DISPID(1));
  TAutoArgs<0> _args;
  OlePropertyGet(_dispid, _args);
  return (Kgaxlib_tlb::KDocumentType /*[C3]*/)(int)_args.GetRetVariant();
}

template <class T> void __fastcall
_DKGAXDispT<T>::set_DocumenFileName(BSTR /*[VT_BSTR:0]*/ Value)
{
  _TDispID _dispid(*this, OLETEXT("DocumenFileName"), DISPID(2));
  TAutoArgs<1> _args;
  _args[1] = Value;
  OlePropertyPut(_dispid, _args);
}

template <class T> BSTR /*[VT_BSTR:0]*/ __fastcall
_DKGAXDispT<T>::get_DocumenFileName()
{
  _TDispID _dispid(*this, OLETEXT("DocumenFileName"), DISPID(2));
  TAutoArgs<0> _args;
  OlePropertyGet(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> void __fastcall
_DKGAXDispT<T>::set_Document3DDrawMode(Kgaxlib_tlb::KDocument3DDrawMode /*[VT_USERDEFINED:0]*/ Value)
{
  _TDispID _dispid(*this, OLETEXT("Document3DDrawMode"), DISPID(3));
  TAutoArgs<1> _args;
  _args[1] = (int) /*[VT_I4:0]*/ (Kgaxlib_tlb::KDocument3DDrawMode /*[C2]*/)Value;
  OlePropertyPut(_dispid, _args);
}

template <class T> Kgaxlib_tlb::KDocument3DDrawMode /*[VT_USERDEFINED:0]*/ __fastcall
_DKGAXDispT<T>::get_Document3DDrawMode()
{
  _TDispID _dispid(*this, OLETEXT("Document3DDrawMode"), DISPID(3));
  TAutoArgs<0> _args;
  OlePropertyGet(_dispid, _args);
  return (Kgaxlib_tlb::KDocument3DDrawMode /*[C3]*/)(int)_args.GetRetVariant();
}

template <class T> void __fastcall
_DKGAXDispT<T>::set_Document3DWireframeShadedMode(TOLEBOOL /*[VT_BOOL:0]*/ Value)
{
  _TDispID _dispid(*this, OLETEXT("Document3DWireframeShadedMode"), DISPID(4));
  TAutoArgs<1> _args;
  _args[1] = Value;
  OlePropertyPut(_dispid, _args);
}

template <class T> TOLEBOOL /*[VT_BOOL:0]*/ __fastcall
_DKGAXDispT<T>::get_Document3DWireframeShadedMode()
{
  _TDispID _dispid(*this, OLETEXT("Document3DWireframeShadedMode"), DISPID(4));
  TAutoArgs<0> _args;
  OlePropertyGet(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> Ks_tlb::KompasObjectPtr __fastcall
_DKGAXDispT<T>::GetKompasObject()
{
  _TDispID _dispid(*this, OLETEXT("GetKompasObject"), DISPID(5));
  TAutoArgs<0> _args;
  OleFunction(_dispid, _args);
  return (Ks_tlb::KompasObject* /*[C1]*/)(LPDISPATCH) /*[VT_DISPATCH:1]*/_args.GetRetVariant();
}

template <class T> Kgaxlib_tlb::KDocumentType __fastcall
_DKGAXDispT<T>::GetDocumentType(OleVariant index/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("GetDocumentType"), DISPID(6));
  TAutoArgs<1> _args;
  _args[1] = index /*[VT_VARIANT:0]*/;
  OleFunction(_dispid, _args);
  return (Kgaxlib_tlb::KDocumentType /*[C1]*/)(int) /*[VT_I4:0]*/_args.GetRetVariant();
}

template <class T> LPDISPATCH __fastcall
_DKGAXDispT<T>::GetDocumentInterface(OleVariant index/*[in]*/, long newAPI)
{
  _TDispID _dispid(*this, OLETEXT("GetDocumentInterface"), DISPID(7));
  TAutoArgs<2> _args;
  _args[1] = index /*[VT_VARIANT:0]*/;
  _args[2] = newAPI /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> long __fastcall
_DKGAXDispT<T>::GetActiveDocumentID()
{
  _TDispID _dispid(*this, OLETEXT("GetActiveDocumentID"), DISPID(8));
  TAutoArgs<0> _args;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> long __fastcall
_DKGAXDispT<T>::GetDocumentsCount()
{
  _TDispID _dispid(*this, OLETEXT("GetDocumentsCount"), DISPID(9));
  TAutoArgs<0> _args;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> long __fastcall
_DKGAXDispT<T>::AddDocument(BSTR fileName/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("AddDocument"), DISPID(10));
  TAutoArgs<1> _args;
  _args[1] = fileName /*[VT_BSTR:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> long __fastcall
_DKGAXDispT<T>::AddNewDocument(Kgaxlib_tlb::KDocumentType type/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("AddNewDocument"), DISPID(11));
  TAutoArgs<1> _args;
  _args[1] = (int)type /*[VT_USERDEFINED:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> long __fastcall
_DKGAXDispT<T>::InsertDocument(BSTR fileName/*[in]*/, OleVariant index/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("InsertDocument"), DISPID(12));
  TAutoArgs<2> _args;
  _args[1] = fileName /*[VT_BSTR:0]*/;
  _args[2] = index /*[VT_VARIANT:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> long __fastcall
_DKGAXDispT<T>::InsertNewDocument(Kgaxlib_tlb::KDocumentType type/*[in]*/, 
                                  OleVariant index/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("InsertNewDocument"), DISPID(13));
  TAutoArgs<2> _args;
  _args[1] = (int)type /*[VT_USERDEFINED:0]*/;
  _args[2] = index /*[VT_VARIANT:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
_DKGAXDispT<T>::RemoveDocument(OleVariant index/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("RemoveDocument"), DISPID(14));
  TAutoArgs<1> _args;
  _args[1] = index /*[VT_VARIANT:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
_DKGAXDispT<T>::ActivateDocument(OleVariant index/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("ActivateDocument"), DISPID(15));
  TAutoArgs<1> _args;
  _args[1] = index /*[VT_VARIANT:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> long __fastcall
_DKGAXDispT<T>::CloseAll()
{
  _TDispID _dispid(*this, OLETEXT("CloseAll"), DISPID(16));
  TAutoArgs<0> _args;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> int __fastcall
_DKGAXDispT<T>::TestLoadDocument(BSTR fileName/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("TestLoadDocument"), DISPID(17));
  TAutoArgs<1> _args;
  _args[1] = fileName /*[VT_BSTR:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> TOLEBOOL __fastcall
_DKGAXDispT<T>::InvalidateActiveDocument(TOLEBOOL erase/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("InvalidateActiveDocument"), DISPID(18));
  TAutoArgs<1> _args;
  _args[1] = erase /*[VT_BOOL:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> void __fastcall
_DKGAXDispT<T>::ZoomEntireDocument()
{
  _TDispID _dispid(*this, OLETEXT("ZoomEntireDocument"), DISPID(19));
  OleProcedure(_dispid);
}

template <class T> void __fastcall
_DKGAXDispT<T>::MoveViewDocument()
{
  _TDispID _dispid(*this, OLETEXT("MoveViewDocument"), DISPID(20));
  OleProcedure(_dispid);
}

template <class T> void __fastcall
_DKGAXDispT<T>::PanoramaViewDocument()
{
  _TDispID _dispid(*this, OLETEXT("PanoramaViewDocument"), DISPID(21));
  OleProcedure(_dispid);
}

template <class T> void __fastcall
_DKGAXDispT<T>::RotateViewDocument()
{
  _TDispID _dispid(*this, OLETEXT("RotateViewDocument"), DISPID(22));
  OleProcedure(_dispid);
}

template <class T> void __fastcall
_DKGAXDispT<T>::OrientationDocument()
{
  _TDispID _dispid(*this, OLETEXT("OrientationDocument"), DISPID(23));
  OleProcedure(_dispid);
}

template <class T> void __fastcall
_DKGAXDispT<T>::ZoomWindow(Kgaxlib_tlb::KZoomType type/*[in,def,opt]*/)
{
  _TDispID _dispid(*this, OLETEXT("ZoomWindow"), DISPID(24));
  TAutoArgs<1> _args;
  _args[1] = (int)type /*[VT_USERDEFINED:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXDispT<T>::StopCurrentProcess(TOLEBOOL cancel/*[in,def,opt]*/)
{
  _TDispID _dispid(*this, OLETEXT("StopCurrentProcess"), DISPID(25));
  TAutoArgs<1> _args;
  _args[1] = cancel /*[VT_BOOL:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> TOLEBOOL __fastcall
_DKGAXDispT<T>::DrawToDC(OLE_HANDLE dc/*[in]*/, long left/*[in]*/, long top/*[in]*/, 
                         long width/*[in]*/, long height/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("DrawToDC"), DISPID(26));
  TAutoArgs<5> _args;
  _args[1] = dc /*[VT_INT:0]*/;
  _args[2] = left /*[VT_I4:0]*/;
  _args[3] = top /*[VT_I4:0]*/;
  _args[4] = width /*[VT_I4:0]*/;
  _args[5] = height /*[VT_I4:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

template <class T> void __fastcall
_DKGAXDispT<T>::SetCurrentLibManager(long t/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("SetCurrentLibManager"), DISPID(27));
  TAutoArgs<1> _args;
  _args[1] = t /*[VT_I4:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXDispT<T>::SetGabaritModifying()
{
  _TDispID _dispid(*this, OLETEXT("SetGabaritModifying"), DISPID(28));
  OleProcedure(_dispid);
}

template <class T> long __fastcall
_DKGAXDispT<T>::GetDocumentID(OleVariant index/*[in]*/)
{
  _TDispID _dispid(*this, OLETEXT("GetDocumentID"), DISPID(29));
  TAutoArgs<1> _args;
  _args[1] = index /*[VT_VARIANT:0]*/;
  OleFunction(_dispid, _args);
  return _args.GetRetVariant();
}

// *********************************************************************//
// DispIntf:  _DKGAXEvents
// Flags:     (4096) Dispatchable
// GUID:      {464F746A-AC6D-4919-82E9-A7363E661ECF}
// *********************************************************************//
template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgMouseDown(short nButton/*[in]*/, short nShiftState/*[in]*/, long x/*[in]*/
                                    , long y/*[in]*/, TOLEBOOL* proceed/*[out]*/)
{
  _TDispID _dispid(/* OnKgMouseDown */ DISPID(1));
  TAutoArgs<5> _args;
  _args[1] = nButton /*[VT_I2:0]*/;
  _args[2] = nShiftState /*[VT_I2:0]*/;
  _args[3] = x /*[VT_I4:0]*/;
  _args[4] = y /*[VT_I4:0]*/;
  _args[5] = proceed /*[VT_BOOL:1]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgMouseUp(short nButton/*[in]*/, short nShiftState/*[in]*/, long x/*[in]*/, 
                                  long y/*[in]*/, TOLEBOOL* proceed/*[out]*/)
{
  _TDispID _dispid(/* OnKgMouseUp */ DISPID(2));
  TAutoArgs<5> _args;
  _args[1] = nButton /*[VT_I2:0]*/;
  _args[2] = nShiftState /*[VT_I2:0]*/;
  _args[3] = x /*[VT_I4:0]*/;
  _args[4] = y /*[VT_I4:0]*/;
  _args[5] = proceed /*[VT_BOOL:1]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgMouseDblClick(short nButton/*[in]*/, short nShiftState/*[in]*/, 
                                        long x/*[in]*/, long y/*[in]*/, TOLEBOOL* proceed/*[out]*/)
{
  _TDispID _dispid(/* OnKgMouseDblClick */ DISPID(3));
  TAutoArgs<5> _args;
  _args[1] = nButton /*[VT_I2:0]*/;
  _args[2] = nShiftState /*[VT_I2:0]*/;
  _args[3] = x /*[VT_I4:0]*/;
  _args[4] = y /*[VT_I4:0]*/;
  _args[5] = proceed /*[VT_BOOL:1]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgStopCurrentProcess()
{
  _TDispID _dispid(/* OnKgStopCurrentProcess */ DISPID(4));
  OleProcedure(_dispid);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgCreate(long docID/*[in]*/)
{
  _TDispID _dispid(/* OnKgCreate */ DISPID(5));
  TAutoArgs<1> _args;
  _args[1] = docID /*[VT_I4:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgPaint(Kgaxlib_tlb::PaintObjectPtr paintObj/*[in]*/)
{
  _TDispID _dispid(/* OnKgPaint */ DISPID(6));
  TAutoArgs<1> _args;
  _args[1] = (LPDISPATCH)(Kgaxlib_tlb::PaintObject*)paintObj /*[VT_USERDEFINED:1]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgCreateGLList(Kgaxlib_tlb::GLObjectPtr glObj/*[in]*/, 
                                       Kgaxlib_tlb::KDocument3DDrawMode drawMode/*[in]*/)
{
  _TDispID _dispid(/* OnKgCreateGLList */ DISPID(7));
  TAutoArgs<2> _args;
  _args[1] = (LPDISPATCH)(Kgaxlib_tlb::GLObject*)glObj /*[VT_USERDEFINED:1]*/;
  _args[2] = (int)drawMode /*[VT_USERDEFINED:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgAddGabatit(Kgaxlib_tlb::GabaritObjectPtr gabObj/*[in]*/)
{
  _TDispID _dispid(/* OnKgAddGabatit */ DISPID(8));
  TAutoArgs<1> _args;
  _args[1] = (LPDISPATCH)(Kgaxlib_tlb::GabaritObject*)gabObj /*[VT_USERDEFINED:1]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgErrorLoadDocument(long docID/*[in]*/, BSTR fileName/*[in]*/, 
                                            long errorID/*[in]*/)
{
  _TDispID _dispid(/* OnKgErrorLoadDocument */ DISPID(9));
  TAutoArgs<3> _args;
  _args[1] = docID /*[VT_I4:0]*/;
  _args[2] = fileName /*[VT_BSTR:0]*/;
  _args[3] = errorID /*[VT_I4:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgKeyDown(long* key/*[in,out]*/, short nShiftState/*[in]*/)
{
  _TDispID _dispid(/* OnKgKeyDown */ DISPID(10));
  TAutoArgs<2> _args;
  _args[1] = key /*[VT_I4:1]*/;
  _args[2] = nShiftState /*[VT_I2:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgKeyUp(long* key/*[in,out]*/, short nShiftState/*[in]*/)
{
  _TDispID _dispid(/* OnKgKeyUp */ DISPID(11));
  TAutoArgs<2> _args;
  _args[1] = key /*[VT_I4:1]*/;
  _args[2] = nShiftState /*[VT_I2:0]*/;
  OleProcedure(_dispid, _args);
}

template <class T> void __fastcall
_DKGAXEventsDispT<T>::OnKgKeyPress(long* key/*[in,out]*/)
{
  _TDispID _dispid(/* OnKgKeyPress */ DISPID(12));
  TAutoArgs<1> _args;
  _args[1] = key /*[VT_I4:1]*/;
  OleProcedure(_dispid, _args);
}

#endif  //   __TLB_NO_INTERFACE_WRAPPERS


#if !defined(__TLB_NO_EVENT_WRAPPERS) && defined(USING_ATLVCL)
// *********************************************************************//
// CONNECTIONPOINT/EVENT PROXY
// CoClass         : KGAX
// Event Interface : _DKGAXEvents
// *********************************************************************//
template <class T>
class TEvents_KGAX : public IConnectionPointImpl<T,
                                                 &DIID__DKGAXEvents,
                                                 CComUnkArray<CONNECTIONPOINT_ARRAY_SIZE> >
{
public:
  void            Fire_OnKgMouseDown(short nButton, short nShiftState, long x, long y, 
                                     TOLEBOOL* proceed);
  void            Fire_OnKgMouseUp(short nButton, short nShiftState, long x, long y, 
                                   TOLEBOOL* proceed);
  void            Fire_OnKgMouseDblClick(short nButton, short nShiftState, long x, long y, 
                                         TOLEBOOL* proceed);
  void            Fire_OnKgStopCurrentProcess(void);
  void            Fire_OnKgCreate(long docID);
  void            Fire_OnKgPaint(Kgaxlib_tlb::PaintObjectPtr paintObj);
  void            Fire_OnKgCreateGLList(Kgaxlib_tlb::GLObjectPtr glObj, 
                                        Kgaxlib_tlb::KDocument3DDrawMode drawMode);
  void            Fire_OnKgAddGabatit(Kgaxlib_tlb::GabaritObjectPtr gabObj);
  void            Fire_OnKgErrorLoadDocument(long docID, BSTR fileName, long errorID);
  void            Fire_OnKgKeyDown(long* key, short nShiftState);
  void            Fire_OnKgKeyUp(long* key, short nShiftState);
  void            Fire_OnKgKeyPress(long* key);
protected:
  _DKGAXEventsDisp m_EventIntfObj;
};

template <class T> void
TEvents_KGAX<T>::Fire_OnKgMouseDown(short nButton, short nShiftState, long x, long y, 
                                    TOLEBOOL* proceed)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgMouseDown(nButton, nShiftState, x, y, proceed);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgMouseUp(short nButton, short nShiftState, long x, long y, 
                                  TOLEBOOL* proceed)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgMouseUp(nButton, nShiftState, x, y, proceed);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgMouseDblClick(short nButton, short nShiftState, long x, long y, 
                                        TOLEBOOL* proceed)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgMouseDblClick(nButton, nShiftState, x, y, proceed);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgStopCurrentProcess(void)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgStopCurrentProcess();
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgCreate(long docID)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgCreate(docID);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgPaint(Kgaxlib_tlb::PaintObjectPtr paintObj)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgPaint(paintObj);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgCreateGLList(Kgaxlib_tlb::GLObjectPtr glObj, 
                                       Kgaxlib_tlb::KDocument3DDrawMode drawMode)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgCreateGLList(glObj, drawMode);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgAddGabatit(Kgaxlib_tlb::GabaritObjectPtr gabObj)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgAddGabatit(gabObj);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgErrorLoadDocument(long docID, BSTR fileName, long errorID)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgErrorLoadDocument(docID, fileName, errorID);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgKeyDown(long* key, short nShiftState)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgKeyDown(key, nShiftState);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgKeyUp(long* key, short nShiftState)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgKeyUp(key, nShiftState);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

template <class T> void
TEvents_KGAX<T>::Fire_OnKgKeyPress(long* key)
{
  T * pT = (T*)this;
  pT->Lock();
  IUnknown ** pp = m_vec.begin();
  while (pp < m_vec.end())
  {
    if (*pp != NULL)
    {
      m_EventIntfObj.Attach(*pp);
      m_EventIntfObj.OnKgKeyPress(key);
      m_EventIntfObj.Attach(0);
    }
    pp++;
  }
  pT->Unlock();
}

#endif  //   __TLB_NO_EVENT_WRAPPERS

};     // namespace Kgaxlib_tlb

#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using  namespace Kgaxlib_tlb;
#endif

#pragma option pop

#endif // __KGAXLib_TLB_h__
